package xyz.xmh.pattern.structural.filterpattern;

import java.util.ArrayList;
import java.util.List;

/**
 * CriteriaFemale
 * 女性标准
 *
 * @author xuMingHai
 * @since 2021/4/30 星期五 14:13
 */
public class CriteriaFemale implements Criteria {
    @Override
    public List<Person> meetCriteria(List<Person> personList) {
        List<Person> femalePersonList = new ArrayList<>();

        // 遍历集合过去性别为女性
        for (Person person : personList) {

            if ("FEMALE".equalsIgnoreCase(person.getGender())) {
                femalePersonList.add(person);
            }
        }

        return femalePersonList;
    }
}
